<template>
  <view>
    <view
      @click="onClick"
      :data-string="string"
      :data-string2="string2"
      :data-number="number"
      :data-object="object"
      data-text="test"
      :string="string"
      class="text"
    >content:</view>
  </view>
</template>

<script>
export default {
  data () {
    return {
      string: 'string',
      string2: '123',
      number: 123,
      object: { a: 'a' }
    }
  },
  methods: {
    onClick (event) {
      console.log(event)
    }
  }
}
</script>

<style>
.text::after {
  content: attr(data-string);
}
</style>